package com.desyang.server;

import com.desyang.common.service.UserService;
import com.desyang.common.service.impl.UserServiceImpl;
import com.desyang.server.net.RpcServer;
import com.desyang.server.net.impl.RpcServerImpl;
import com.desyang.server.provider.ServiceProvider;

public class Server {
    public static void main(String[] args) throws Exception {
        UserService userService = new UserServiceImpl();

        ServiceProvider serviceProvider = new ServiceProvider();
        serviceProvider.register(userService);

        RpcServer recServer = new RpcServerImpl(serviceProvider);

        System.out.println("server started...");
        recServer.start(9999);
    }
}
